#include "include/logger.hpp"
#include <sstream>
logger* logger::_pInstance=nullptr;
Category* logger::_root=nullptr;
logger::logger(){}
logger::~logger(){}

void logger::warn(const char* file,int line,const char * func,const char *msg){
    stringstream sst;
    sst.str("");
    sst.clear();
    sst<<file<<" "<<line<<" "<<func<<" "<<msg;
    logger::_root->warn(sst.str());
}

void logger::error(const char* file,int line,const char * func,const char *msg){
    stringstream sst;
    sst.str("");
    sst.clear();
    sst<<file<<" "<<line<<" "<<func<<" "<<msg;
    logger::_root->error(sst.str());
}

void logger::debug(const char* file,int line,const char * func,const char *msg){
    stringstream sst;
    sst.str("");
    sst.clear();
    sst<<file<<" "<<line<<" "<<func<<" "<<msg;

    logger::_root->debug(sst.str());
}

void logger::info(const char* file,int line,const char * func,const char *msg){
    stringstream sst;
    sst.str("");
    sst.clear();
    sst<<file<<" "<<line<<" "<<func<<" "<<msg;
    logger::_root->info(sst.str());
}


